package book.ch12;

class Car extends Thread {
    public void run(){
        for(int i=0;i<200;i++){
            System.out.println("子线程一："+i);
        }
    }
}

class Elephent implements Runnable{
    public void run(){
        for(int i=0;i<200;i++){
            System.out.println("子线程二："+i);
        }
    }
}


public class E12_1 {
    public static void main(String[] args) {

        Car car1=new Car();
        Elephent eph1=new Elephent();

        Thread task1=new Thread(car1);
        Thread task2=new Thread(eph1);
        //task1.start();
        //task2.start();

        
      //  eph1.start();

        for(int i=0;i<150;i++){
            System.out.println("主线程："+i+"  ");
        }


    }
}
